﻿// -------------------------------------------------------------------------
//    @FileName         :    LoginAction.h
//    @Author           :    gaoyi
//    @Date             :    24-8-7
//    @Email            :    445267987@qq.com
//    @Module           :    LoginAction
//
// -------------------------------------------------------------------------

#pragma once

#include "IAction.h"

class GameApi;

class LoginReqAction : public IAction
{
public:
	LoginReqAction(GameApi* pGameAPI): IAction(pGameAPI)
	{
	}

	virtual ~LoginReqAction()
	{
	}

	virtual int MakePacket();
	virtual int HandleCSPacket(int iCmd, proto_ff::Proto_CSRsp& oCSRsp, bool& bIsEnd);
};

class CreateRoleAction : public IAction
{
public:
	CreateRoleAction(GameApi* pGameAPI): IAction(pGameAPI)
	{
	}

	virtual ~CreateRoleAction()
	{
	}

	virtual int MakePacket();
	virtual int HandleCSPacket(int iCmd, proto_ff::Proto_CSRsp& oCSRsp, bool& bIsEnd);
};

class GetRoleAction : public IAction
{
public:
	GetRoleAction(GameApi* pGameAPI): IAction(pGameAPI)
	{
	}

	virtual ~GetRoleAction()
	{
	}

	virtual int MakePacket();
	virtual int HandleCSPacket(int iCmd, proto_ff::Proto_CSRsp& oCSRsp, bool& bIsEnd);
};

class HeartBeatAction : public IAction
{
public:
	HeartBeatAction(GameApi* pGameAPI): IAction(pGameAPI)
	{
	}

	virtual ~HeartBeatAction()
	{
	}

	virtual int MakePacket();
	virtual int HandleCSPacket(int iCmd, proto_ff::Proto_CSRsp& oCSRsp, bool& bIsEnd);
};

class MapQueryAction : public IAction
{
public:
	MapQueryAction(GameApi* pGameAPI, bool bIsMoveScene): IAction(pGameAPI) { m_bIsMoveScene = bIsMoveScene; }

	virtual ~MapQueryAction()
	{
	}

	bool IsMoveScene() { return m_bIsMoveScene; }

	virtual int MakePacket();
	virtual int HandleCSPacket(int iCmd, proto_ff::Proto_CSRsp& oCSRsp, bool& bIsEnd);
private:
	bool m_bIsMoveScene;
};
